<?php

/**
 * siteconfig form base class.
 *
 * @method siteconfig getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasesiteconfigForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ID'                    => new sfWidgetFormInputHidden(),
      'ClassName'             => new sfWidgetFormChoice(array('choices' => array('SiteConfig' => 'SiteConfig'))),
      'Created'               => new sfWidgetFormDateTime(),
      'LastEdited'            => new sfWidgetFormDateTime(),
      'Title'                 => new sfWidgetFormInputText(),
      'Tagline'               => new sfWidgetFormInputText(),
      'Theme'                 => new sfWidgetFormInputText(),
      'CanViewType'           => new sfWidgetFormChoice(array('choices' => array('Anyone' => 'Anyone', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
      'CanEditType'           => new sfWidgetFormChoice(array('choices' => array('LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
      'CanCreateTopLevelType' => new sfWidgetFormChoice(array('choices' => array('LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
    ));

    $this->setValidators(array(
      'ID'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ID')), 'empty_value' => $this->getObject()->get('ID'), 'required' => false)),
      'ClassName'             => new sfValidatorChoice(array('choices' => array(0 => 'SiteConfig'), 'required' => false)),
      'Created'               => new sfValidatorDateTime(array('required' => false)),
      'LastEdited'            => new sfValidatorDateTime(array('required' => false)),
      'Title'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'Tagline'               => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'Theme'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'CanViewType'           => new sfValidatorChoice(array('choices' => array(0 => 'Anyone', 1 => 'LoggedInUsers', 2 => 'OnlyTheseUsers'), 'required' => false)),
      'CanEditType'           => new sfValidatorChoice(array('choices' => array(0 => 'LoggedInUsers', 1 => 'OnlyTheseUsers'), 'required' => false)),
      'CanCreateTopLevelType' => new sfValidatorChoice(array('choices' => array(0 => 'LoggedInUsers', 1 => 'OnlyTheseUsers'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('siteconfig[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'siteconfig';
  }

}
